export const actions = {
  addCount() {
    return {
      type: "global.addCount",
    };
  },
  reduceCount() {
    return {
      type: "global.reduceCount",
    };
  },
  changeLoading(status) {
    return {
      type: "global.changeLoading",
      preload: status,
    };
  },
};

export const reducer = {
  addCount(state, action) {
    return {
      ...state,
      count: ++state.count,
    };
  },
  reduceCount(state, action) {
    return {
      ...state,
      count: --state.count,
    };
  },
  changeLoading(state, action) {
    return {
      ...state,
      loading: action.preload,
    };
  },
};
